#ifndef ARTILLERYSYSTEM_USERINTERFACE_H
#define ARTILLERYSYSTEM_USERINTERFACE_H

#include <string>
#include <vector>

#include <cpp-i18n/Translator.hpp>
#include "keys-enum/KeysEnum.h"
#include "../services/MainService.h"


class MainMenu;

class PreviewMenu;

class SoldiersMenu;

class CrewsMenu;

class BattalionsMenu;

class UnitsMenu;

class MissilesMenu;

class OperatorManualMenu;

class AboutAuthorMenu;

class AboutProgramMenu;

enum Pages {
    PREVIEW_MENU,
    MAIN_MENU,
    SOLDIERS_MENU,
    UNITS_MENU,
    CREWS_MENU,
    BATTALIONS_MENU,
    MISSILES_MENU,
    OPERATOR_MANUAL_MENU,
    ABOUT_PROGRAM_MENU,
    ABOUT_AUTHOR_MENU,
    EXIT
};

class UserInterface {
private:
    i18n::Translator t;
    i18n::LocaleConfig config;
    MainMenu *mainMenu;
    PreviewMenu *previewMenu;
    SoldiersMenu *soldiersMenu;
    UnitsMenu *unitsMenu;
    CrewsMenu *crewsMenu;
    BattalionsMenu *battalionsMenu;
    MissilesMenu *missilesMenu;
    OperatorManualMenu *operatorManualMenu;
    AboutAuthorMenu *aboutAuthorMenu;
    AboutProgramMenu *aboutProgramMenu;
    MainService *mainService;
    Pages currentPage;
public:
    Pages getCurrentPage() const;

    void setCurrentPage(Pages currentPage);

    UserInterface(std::string defaultLocale, std::vector<std::string> supportedLocales, MainService *mainService);

    virtual ~UserInterface();

    static Keys::Key getPressedKey();

    void run();

    void toggleLocale();

};

#include "pages/main-menu/MainMenu.h"
#include "pages/preview-menu/PreviewMenu.h"
#include "pages/soldiers-menu/SoldiersMenu.h"
#include "pages/crews-menu/CrewsMenu.h"
#include "pages/battalions-menu/BattalionsMenu.h"
#include "pages/units-menu/UnitsMenu.h"
#include "pages/missiles-menu/MissilesMenu.h"
#include "pages/operator-manual-menu/OperatorManualMenu.h"
#include "pages/about-author-menu/AboutAuthorMenu.h"
#include "pages/about-program-menu/AboutProgramMenu.h"

#endif